package com.etc.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.etc.dao.EmployeeMapper;
import com.etc.entity.Employee;
import com.etc.service.EmployeeService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

@Service
public class EmployeeServiceImpl implements EmployeeService {
	
	//注入EmployeeMapper
	@Autowired
	private EmployeeMapper mapper;

	@Override
	public Page<Employee> getByPage(int page, int limit, String keywords) {
		//执行分页操作别忘记了
		PageHelper.startPage(page, limit);
		return mapper.getByLike("%"+keywords+"%");
	}

}
